package priv.pront.code.lanqiao.team.comp.mati_2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-11-02 20:02
 */
public class P1321_单词覆盖还原 {

    static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    static String[] boy = {"b", "o", "y"};
    static String[] girl = {"g", "i", "r", "l"};
    static int bidx, gidx;
    static int ans;
    static Map<String, Integer> bm = new HashMap<>();
    static Map<String, Integer> gm = new HashMap<>();
    static int b, g;

    public static void main(String[] args) throws IOException {
        String s = bf.readLine();
        for (int i = 0; i < s.length(); i++) {

            if (s.charAt(i) == 'b') b++;
            if (s.charAt(i) == 'o' && s.charAt(i - 1) != 'b') b++;
            if (s.charAt(i) == 'y' && s.charAt(i - 1) != 'o' && s.charAt(i - 2) != 'b') b++;
            //boy的运算
            if (s.charAt(i) == 'g') g++;
            if (s.charAt(i)== 'i' && s.charAt(i - 1) != 'g') g++;
            if (s.charAt(i) == 'r' && s.charAt(i - 1) != 'i' && s.charAt(i - 2) != 'g') g++;
            if (s.charAt(i) == 'l' && s.charAt(i - 1) != 'r' && s.charAt(i - 2) != 'i' && s.charAt(i - 3) != 'g') g++;
            //girl的运算
        }
        System.out.println(b);
        System.out.println(g);
    }
}
